<template>
  <div class="app-container">
    <!-- 添加或修改利息分摊对话框 -->
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="保留位数" prop="feeStandards">
          <el-select v-model="form.feeStandards" placeholder="请选择收费保留位数" clearable :style="{width: '300px'}">
            <el-option
              v-for="dict in dict.type.HOUSE024"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"

            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="维修留存比例" prop="retained">
          <el-input v-model="form.retained" placeholder="请输入维修留存比例"   clearable :style="{width: '300px'}"/>
        </el-form-item>
        <el-form-item label="是否允许负债" prop="beInDebtSys">
          <el-select v-model="form.beInDebtSys" placeholder="请选择是否允许负债" clearable :style="{width: '300px'}">
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否允许扣除利息" prop="buckleRateSys">
          <el-select v-model="form.buckleRateSys" placeholder="请选择是否允许扣除利息" clearable :style="{width: '300px'}">
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
         </el-form>
      <div slot="footer" class="dialog-footer" label-width="800px">
        <el-button type="primary" @click="submitForm">修改参数</el-button>
      </div>

  </div>
</template>

<script>
import { getHouseSetUpT, updateHouseSetUpT } from "@/api/house/HouseSetUpT";

export default {
  name: "HouseSetUpT",
  dicts: ['HOUSE024','sys_yes_no'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 参数设定表格数据
      HouseSetUpTList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.handleUpdate();
  },
  methods: {
    /** 修改按钮操作 */
    handleUpdate() {
      getHouseSetUpT().then(response => {
        debugger
        this.form = response.data;
      });
    },
    /** 提交按钮 */
    submitForm() {
      updateHouseSetUpT(this.form).then(response => {
        this.$modal.msgSuccess("修改成功");
        this.getHouseSetUpT();
      });
    }
  }
};
</script>
<style>
.dialog-footer {
  text-align: center;
}
</style>
